﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XingLucifer.Devices
{
    public interface PLCBase
    {
        bool Connection();
        void Close();
        bool WriteStringAsUInt16(string addr, string values);
        bool WriteString(string addr, string values);

        public bool Write<T>(string addr, T[] values);

        public bool ReadAndReturnBit(string addr);

        List<UInt32> ReadUInt32(string addr, int count);

        List<UInt16> Read(string addr, int count);

        Task<List<UInt16>> ReadAsync(string addr, int count);

        Task<bool> ConnectionAsync();

        string ReadString(string addr, int count);

        string ToString(IEnumerable<UInt16> values);
        bool ReadBool(string addr);

        bool ClearPLCAddress(string addr, int length);

    }
}
